/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.model.disc.integrationpoint;

/**
*A class representing a Gauss Point.
*
*@author Lucas, Marcelo & Pitangueira, Roque
*@version 1.0
*@since May 2004
*/

public class GaussPoint extends IntegrationPoint
{
//Coordenadas dos pontos de Gauss
	/** The two dimensional array containing the POSSIBLE coordinates of this GaussPoint. */
	private static final double[][] 
	gaussCoords = {
//1 ponto de Gauss
	{0.0}, 
//2 pontos de Gauss
	{-0.5773502692, 0.5773502692}, 
//3 pontos de Gauss
	{-0.7745966692, 0.0, 0.7745966692}, 
//4 pontos de Gauss
	{-0.8611363116, -0.3399810436, 0.8611363116, 0.3399810436},
//5 pontos de Gauss
	{-0.9061798459, -0.5384693101, 0.0, 0.9061798459, 0.5384693101}, 
//6 pontos de Gauss
	{-0.9324695142, -0.6612093865, -0.2386191861, 0.9324695142, 0.6612093865, 0.2386191861},
//7 pontos de Gauss
	{-0.9491079123, -0.7415311856, -0.4058451514, 0.0, 0.9491079123, 0.7415311856, 0.4058451514}, 
//8 pontos de Gauss
	{-0.9602898565, -0.7966664774, -0.5255324099, -0.1834346425, 0.9602898565, 0.7966664774, 0.5255324099, 0.1834346425}
};

//Pesos relacionados aos pontos de Gauss
	/** The vector containing the product of POSSIBLE weights of this GaussPoint. */
	private static final double[][] 
	gaussWeights =
{
//peso para 1 ponto de Gauss
	{2.0}, 
//pesos para 2 pontos de Gauss
	{1.0, 1.0},
//pesos para 3 pontos de Gauss
	{0.5555555556, 0.8888888889, 0.5555555556},
//pesos para 4 pontos de Gauss
	{0.3478548451, 0.6521451549, 0.3478548451, 0.6521451549},
//pesos para 5 pontos de Gauss
	{0.2369268851, 0.4786286705, 0.5688888889, 0.2369268851, 0.4786286705},
//pesos para 6 pontos de Gauss
	{0.1713244924, 0.3607615730, 0.4679139346, 0.1713244924, 0.3607615730, 0.4679139346},
//pesos para 7 pontos de Gauss
	{0.1294849662, 0.2797053915, 0.3818300505, 0.4179591837, 0.1294849662, 0.2797053915, 0.3818300505},
//pesos para 8 pontos de Gauss
	{0.1012285363, 0.2223810345, 0.3137066459, 0.3626837834, 0.1012285363, 0.2223810345, 0.3137066459, 0.3626837834}
};

//********************************************************************************

	/** The constructor of this GaussPoint .*/
	public GaussPoint()
	{
		coord_1 = coord_2 = coord_3 = 0.0;
		weight1 = weight2 = weight3 = 1.0;
	}
	
//********************************************************************************
	
	/** Returns the gauss coord xi of this GaussPoint .*/
	public double getCoord1()
	{ 
		return (coord_1);
	}
		
	/** Sets the gaussCoord Xi of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint.
	*/
	public void setCoord1(int a, int b)
	{
		coord_1 = gaussCoords[a][b];
		coords[0] = coord_1;
	}
	
//********************************************************************************
	
	/** Returns the gauss coord eta of this GaussPoint .*/
	public double getCoord2()
	{ 
		return (coord_2);
	}
	
	/** Sets the gaussCoord Eta of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint.
	*/
	public void setCoord2(int a, int b)
	{
		coord_2 = gaussCoords[a][b];
		coords[1] = coord_2;
	}
	
//********************************************************************************		
	
	/** Returns the gauss coord zeta of this GaussPoint .*/
	public double getCoord3()
	{
		return (coord_3);
	}
	
	/** Sets the gaussCoord Zeta of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint.
	*/
	public void setCoord3(int a, int b)
	{
		coord_3 = gaussCoords[a][b];
		coords[2] = coord_3;
	}
	
//********************************************************************************
	
	/** Returns the gauss coord of this GaussPoint .*/
	public double getCoord4()
	{
		return coord_4;
	}
	
	/** Sets the gaussCoord of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint.
	*/
	public void setCoord4(int a, int b) {}
	
//********************************************************************************
	
	/** Returns the product of gauss weights related to this GaussPoint .*/
	public double getWeights()
	{
		return (weight1 * weight2 * weight3);
	}
	
//********************************************************************************

	/** Sets the weight1 of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint
	*/
	public void setWeight1(int a, int b)
	{
		weight1 = gaussWeights[a][b];
	}
	
//********************************************************************************
	
	/** Sets the weight2 of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint
	*/
	public void setWeight2(int a, int b)
	{
		weight2 = gaussWeights[a][b];
	}
	
//********************************************************************************
	
	/** Sets the weight3 of this GaussPoint.
	*@param a The integration order wich this GaussPoint will be used.
	*@param b The number of GaussPoint
	*/
	public void setWeight3(int a, int b)
	{
		weight3 = gaussWeights[a][b];
	}
	
//********************************************************************************
	
	public void setWeight4(int a, int b) {};
	
	public void setWeight(int a, int b) {};
	
//********************************************************************************
	
}
